* clean_mw.do
* This file cleans the minimum wage dataset to be merged to the labor dataset

/*
	03/06/15	JEP		Add rounded mw measure
*/

clear all
version 13.1

cap project, doinfo
if _rc==198 {
	loc master "C:/Users/jorpp/Dropbox (Brown)/Col_Minimum_Wage"
	loc pr=0
}
else {
	project, doinfo
	local master "`r(pdir)'"
	local doname "`r(dofile)'" 
	project, uses("`master'/Data/Importable/MW/serie_salario_minimo.dta")
	loc pr=1
}
* Project calls



use "`master'/Data/Importable/MW/serie_salario_minimo.dta", clear

ren Año year
ren Salariomínimodiario minw_diario
ren Salariomínimomensual minw
ren Variaciónanual varmw_anual

drop Decretos IPC G

ren Subsidio subsidio_transporte

gen minw_subsidio = minw + subsidio_transporte

* Rounded

gen minw_round=round(minw/1000)*1000
gen minw_subsidio_round= round(minw_subsidio/1000)*1000

save "`master'/Data/Clean/MW/serie_salario_minimo.dta", replace

if `pr' project, creates("`master'/Data/Clean/MW/serie_salario_minimo.dta") 